﻿using System;
using System.Windows.Data;

namespace uTrade.Controls
{
    public class StarConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            try
            {
                if ((bool)value)
                {
                    return @"/Resources/Images/favorite.png";
                }
                else
                {
                    return @"/Resources/Images/un-favorite.png";
                }
            }
            catch
            {
                return @"/Resources/Images/un-favorite.png";
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}